<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <script src="vue.js"></script>
    <title>Title</title>
</head>
<body>
<div id="box">
    <span v-text="msg"></span>
    <span v-red="msg">dsadssa</span>
</div>
</body>
<script>
    Vue.directive('red',function (value) {
        console.log(value);
    });
    var app = new Vue({
        el: '#box',
        data: {
            msg: 'welcome'
        }
    })
</script>
</html>